package cn.lhn.ridersclub.controller;

import cn.lhn.ridersclub.dto.Result;
import cn.lhn.ridersclub.service.CaptchaService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/captcha")
public class CaptchaController {

    private final CaptchaService captchaService;

    public CaptchaController(CaptchaService captchaService) {
        this.captchaService = captchaService;
    }

    @GetMapping("/send")
    public Result<?> sendCaptcha(String email, String purposes) {
        captchaService.sendCaptchaMail(email, purposes);
        return Result.success().message("发送成功");
    }
}
